

create view vwEpBom
as 

select a.*,
(select CopGName from EpGoods  as b  where b.CopGNo=a.CopImgNo)  as CopGName,
(select CopGModel from EpGoods  as b  where b.CopGNo=a.CopImgNo)  as CopGModel,
(select ErpUnit from EpGoods  as b  where b.CopGNo=a.CopImgNo)  as ErpUnit
from  EpBom as a

 go
 
 create view vwEpBomSingle
as 

select a.*,
(select CopGName from EpGoods  as b  where b.CopGNo=a.CopImgNo)  as CopGName,
(select CopGModel from EpGoods  as b  where b.CopGNo=a.CopImgNo)  as CopGModel,
(select ErpUnit from EpGoods  as b  where b.CopGNo=a.CopImgNo)  as ErpUnit
from  EpBomSingle as a
